<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<p:dialog widgetVar="dialogoBuscaQuestaoBase" modal="true" width="500" resizable="false"
		closable="true" header="Buscar Questão Base" minWidth="500" >
		<h:form id="formPromptBuscaQuestaoBase">
			<div class="dialogo_container_18">
				<div class="div-dialogo-label dialogo_grid_3">Dificuldade: </div>
				<div class="div-dialogo-input dialogo_grid_4">
					<h:selectOneMenu value="#{provaBean.varDificuldade}" styleClass="dialogo_width_4">
						<f:selectItem value="#{null}" itemValue="#{null}" itemLabel="-- Todas --" />
						<f:selectItems value="#{enumBean.tipoGrauDificuldade}" var="var" />
					</h:selectOneMenu>
				</div>
				<div class="div-dialogo-label dialogo_grid_3">Assunto: </div>
				<div class="div-dialogo-input dialogo_grid_7">
					<h:selectOneMenu value="#{provaBean.varIdAssunto}" styleClass="dialogo_width_4">
						<f:selectItem value="#{null}" itemValue="#{null}" itemLabel="-- Todas --" />
						<f:selectItems value="#{provaBean.palavraChaveList}" var="var" 
							itemValue="#{var.id}" itemLabel="#{var.nome}" />
					</h:selectOneMenu>
				</div>
				<div class="div-dialogo-label dialogo_grid_3">Cabeçalho: </div>
				<div class="div-dialogo-input dialogo_grid_15">
					<p:inputText value="#{provaBean.varCabecalho}" styleClass="dialogo_width_11" style="display: inline;;float: left;"/>
					<ui:include src="/views/layout/ajaxStatus.xhtml" />
					<p:commandButton value="Filtrar" styleClass="prompt-btnFiltro" style="margin-top:-1px;"
						action="#{provaBean.filtrarQuestaoBase}" update="formPromptBuscaQuestaoBase:dataTableBuscaQuestaoBase"/>
				</div>
				<div class="prompt-correcao">&nbsp;</div>
			</div>
			<div>
				<p:dataTable widgetVar="dataTableBuscaQuestaoBase" 
							id="dataTableBuscaQuestaoBase" 
							paginator="true"
							selection="#{provaBean.questaoBaseInstance}" 
							value="#{provaBean.questaoBaseLazyList}" 
							selectionMode="single" var="var"
							emptyMessage="Nenhum registro encontrado!" 
							rows="10" lazy="true" dynamic="true">
					<p:column headerText="Código">  
			            <h:outputText value="#{var.codigo}" />  
			        </p:column>
			        <p:column headerText="Cabeçalho">  
			            <h:outputText value="#{var.cabecalho}" />  
			        </p:column>  
				</p:dataTable>
			</div>
 			<div style="text-align: right;">
           		<br/><p:separator /><br/>  
                <p:commandButton action="#{provaBean.selecionarProva}" value="Selecionar"
                 update="formPrincipal, @form" onclick="dialogoBuscaQuestaoBase.hide()" />
                <p:commandButton type="button" value="Cancelar" onclick="dialogoBuscaQuestaoBase.hide()"/>
            </div>
		</h:form>
	</p:dialog>
</f:view>